<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>锋豫智慧平台</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="lib/layui-v2.6.3/css/layui.css" media="all">
    <link rel="stylesheet" href="css/public.css" media="all">
</head>
<body>
<div class="layuimini-container">
    <div class="layuimini-main">
      <div class="layui-col-lg-offset3 layui-col-lg6">
        <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
            <legend>批量导入日考信息</legend>
        </fieldset>
       <div>
		   <button type="button" class="layui-btn" id="btnup">
		     <i class="layui-icon">&#xe67c;</i>上传Excel数据表格
		   </button>
	   </div>
	   <div>
		   请<a href="/tem/dayexambatch.xls">下载日考成绩批量导入的模版文件</a>
	   </div>
		</div>
    </div>
</div>
<script src="lib/jquery-3.4.1/jquery-3.4.1.min.js"></script>
<script src="lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
<!-- 注意：如果你直接复制所有代码到本地，上述js路径需要改成你本地的 -->
<script>
   layui.use('upload', function(){
     var upload = layui.upload;
      var layer = layui.layer;
     //执行实例
     var uploadInst = upload.render({
       elem: '#btnup' //绑定元素
       ,url: '/api/dayexam/savebatch.do' //上传接口
       ,accept:'file'
       ,done: function(res){
         //上传完毕回调
		 if(res.code==0){
			 layer.msg('学员批量导入成功');
			 location.href="liststudent.html";
		 }else{
			 layer.msg('学员批量导入失败，请重试！');
		 }
       }
       ,error: function(){
         //请求异常回调
         console.log("请求异常回调");
       }
     });
   });
</script>

</body>
</html>